<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="utf-8">
    <title>知识库配置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" th:href="@{/js/layui/css/layui.css}" media="all"/>
    <link rel="stylesheet" th:href="@{/css/public.css}" media="all"/>
    <link rel="stylesheet" th:href="@{/css/knowledgeBase/knowledgeBase.css}" media="all"/>
    <style>
        .layui-layer-page .layui-layer-content {
            overflow: visible;
        !important;
        }

        .layui-col-space10 {
            margin: 0px
        }
    </style>
</head>
<body class="childrenBody" style="-webkit-backface-visibility: hidden;">
    <!--<blockquote class="layui-elem-quote quoteBox">-->
    <fieldset class="layui-elem-field" style="margin-top: 10px;border-width: 2px; border-color: #f2f2f2;">
        <legend style="font-size: large;font-weight: bold;">知识库配置</legend>
        <div class="layui-field-box">
            <form id="exportForm" class="layui-form">
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input searchVal" placeholder="请输入标题搜索" name="key" id="key"/>
                    </div>

                    <div class="layui-input-inline" width="230px">
                        <th:block th:if="${knowledgeTypes!=null}">
                            <select name="knowledgeType" lay-filter="knowledgeType" id="knowledgeType" lay-search="" >
                                <option value="">请选择类型(可输关键词)</option>
                                <option th:each="it:${knowledgeTypes}" th:value="${it.value}" th:text="${it.desc}"></option>
                            </select>
                        </th:block>
                    </div>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input " placeholder="请输入关键词" name="keyworld" id="keyworld"/>
                    </div>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input " placeholder="请输入模糊问法" name="howAskQuestion" id="howAskQuestion"/>
                    </div>

                    <a class="layui-btn search_btn" data-type="reload" id="search"  sec:authorize = "hasAuthority('ROLE_BTN_linkcall:commonKnowledgeBase:search')">搜索</a>
                </div>
                <div class="layui-inline">
                    <th:block th:if="${refPackageId =='' && packageId !='0'}">
                        <a class="layui-btn add_btn" id="add_btn" sec:authorize = "hasAuthority('ROLE_BTN_linkcall:commonKnowledgeBase:add')"><i
                            class="layui-icon">&#xe654;</i>添加问题</a>
                    </th:block>

                    <a class="layui-btn add_btn" id="exportExcel" type="submit" sec:authorize = "hasAuthority('ROLE_BTN_linkcall:commonKnowledgeBase:export')">
                        <i class="layui-icon">&#xe67c;</i>导出Excel
                    </a>
                    <th:block th:if="${affectType == 'c' && refPackageId =='' && packageId !='0' }">
                        <a class="layui-btn add_btn" id="import" sec:authorize = "hasAuthority('ROLE_BTN_linkcall:commonKnowledgeBase:import')">
                            <i class="layui-icon">&#xe67c;</i>导入知识库
                        </a>
                        <a  id="down">下载模板</a>
                    </th:block>
                </div>

                <input name="packageId" th:value="${packageId}" type="hidden">
                <input name="affectType" th:value="${affectType}" type="hidden">
                <input name="refPackageId" th:value="${refPackageId}" type="hidden">
                <input name="keywords" th:value="${keywords}" type="hidden">
               <!-- <input type="hidden" name="createUserId" id="createUserId" th:value="${createUserId}"/>
                <input type="hidden" name="canSearchAll" id="canSearchAll" th:value="${canSearchAll}"/>-->
            </form>
        </div>
    </fieldset>
    <!--</blockquote>-->
    <table id="knowledgeBaseList" lay-filter="knowledgeBaseList"></table>
    <!--操作-->
    <script type="text/html" id="techniqueListBar">
        <!--<button class="layui-btn layui-btn-xs layui-btn-primary">
            <i class="layui-icon">&#xe678;</i>
        </button>-->
        <a class="layui-btn layui-btn-xs" lay-event="edit" sec:authorize = "hasAuthority('ROLE_BTN_linkcall:commonKnowledgeBase:edit')">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" sec:authorize = "hasAuthority('ROLE_BTN_linkcall:commonKnowledgeBase:del')">删除</a>
    </script>

<script th:inline="javascript">
    const baseUrl = [[${#servletContext.contextPath}]];
    const packageId = [[${packageId}]];
    const affectType = [[${affectType}]];
    var keywords = [[${keywords}]];
    const refPackageId = [[${refPackageId}]]; //common 、 private
</script>
<script type="text/javascript"   th:src="@{/js/jquery-1.7.2.min.js}"></script>
<script type="text/javascript" th:src="@{/js/layui/layui.js}" src="../../../static/js/layui/layui.js"></script>
<script type="text/javascript"
        th:src="@{/js/page/knowledgeBase/queryKnowledgeBase.js(v=${new java.util.Date().getTime()})}"></script>
<script type="text/javascript"   th:src="@{/js/page/utils.js}"></script>
</body>


</html>